<?php
require_once ($_SERVER['DOCUMENT_ROOT'].'/../application/configs/settings.php');


//echo "<pre>Post:";
//print_r($_POST);
//echo "</pre>";
//
//echo "<pre>Get:";
//print_r($_GET);
//echo "</pre>";
//
//echo "<pre>Files:";
//print_r($_FILES);
//echo "</pre>";
//
//
//$db=Acl_Mysql_Connect::getInstance($database);
//$sql="SELECT * FROM users";
//$array=$db->fetchArray($sql);
//
//
//echo "<pre>";
//print_r($array);
//echo "</pre>";
//die;

session_start();
if(!isset($_SESSION['email']))
{
	$_GET['controller']='auth';
	$_GET['action']='login';

}

if(isset($_GET['controller']))
	$controller=$_GET['controller'];
else
	$controller='frontend';



switch($controller)
{
	case 'users':
		ob_start();
			include($_SERVER['DOCUMENT_ROOT']."/../application/controllers/users.php");
			$column3=ob_get_flush();
		ob_end_clean();		
	break;
	case 'auth':
		ob_start();
			include($_SERVER['DOCUMENT_ROOT']."/../application/controllers/auth.php");
			$column3=ob_get_flush();
		ob_end_clean();	
//		$column3=Acl_Views_View::showView($controllersPath."/auth.php");		
	break;
	case 'errors':
	
	break;
	case 'frontend':
	default:
		include ($_SERVER['DOCUMENT_ROOT']."/../application/controllers/frontend.php");	
	break;
	
}

include ($_SERVER['DOCUMENT_ROOT']."/../application/layouts/layout.php");


